/**
 * Created by jiadx on 2015/11/20.
 */
define(['ionic'], function () {
    angular.module('SOSalesShipments.utility', [])
        .factory('UtilService', ['ionicU9Tips', '$ionicPopup', function (ionicU9Tips, $ionicPopup) {
            var o = {};

            o.tipsTop = function (tips) {
                ionicU9Tips.show({
                    content: tips,
                    position: 'top',
                    dismissable: true
                });
            };
            o.tipsCenter = function (tips) {
                ionicU9Tips.show({
                    content: tips,
                    position: 'center',
                    dismissable: true,
                    duration: 1000,
                    cssClass: {}
                });
            };
            o.tipsBottom = function (tips) {
                ionicU9Tips.show({
                    content: tips,
                    position: 'bottom',
                    dismissable: true
                });
            };
            o.confirm = function (message, title) {
                return $ionicPopup.confirm({
                    title: title || '消息框',
                    template: message,
                    okText: '确定',
                    okType: 'button-u9',
                    cancelText: '取消',
                    cancelType: 'button-u9'
                });
            };
            return o;
        }])
});
